// import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

// 默认样式
import "@/assets/style/global.less";

// 改变element的配置
Vue.prototype.$ELEMENT = {
  size: "mini",
};

// 登录逻辑引用
import ZeesuuLogin from '@zeesuu/login';
Vue.use(ZeesuuLogin, { store });

// 配置service
import axios from "./utils/axios";
import API from "./config/API";

import ZeesuuService from "@zeesuu/service";
Vue.use(ZeesuuService, {
  $http: axios,
  apis: API,
  debug: process.env.NODE_ENV === "development",
});

// 枚举
import ENUMS from './config/ENUMS.js';
Vue.prototype.$ENUMS = ENUMS;

// 动态下拉框设置
import ZeesuuSelect from '@zeesuu/select';
import CustomSelectData from '@/config/CustomSelectData';

Vue.use(ZeesuuSelect, {
  api: {
    categorySl: { url: '/dict/categories' },
    levelSl: { url: '/dict/hardlevels' },
    jumpSl: { url: '/dict/jumpkinds' },
  },
  custom: CustomSelectData,
});

// 搜索表格
import ZeesuSearchList from '@zeesuu/searchlist';
Vue.use(ZeesuSearchList);

Vue.prototype.$cancel = function () {
  // 获取缓存的 请求取消标识 数组，取消所有关联的请求
  Vue.prototype._cancels_.forEach((cancel) => {
    cancel();
  });
};

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
